#pragma once
#include <vector>
using namespace std;

extern "C"
{
#include "avcodec.h"
#include "avformat.h"
}


class CMediaProp 
{
public:
	CMediaProp(){ memset(this, 0, sizeof(CMediaProp)); };
	~CMediaProp(){};

public:
	PixelFormat pixFmt;
	int width;
	int height;		

	int asampleRate;
	int channels;	
	
};


typedef enum{
	MPEG1,
	QCIF_3GP,
	PSP,
	IPOD,
	DVD_AC3,
	MP3Audio,
	MPEG4MP3
}PROFILE_TYPE;

class COptionParameter
{	
public:
	COptionParameter();
	~COptionParameter();

public:	
	char*  m_strProfileName;		
	wchar_t* m_pszFileName;//output media file name
	PROFILE_TYPE m_eType;
	char* format;
	char* ext;

	int m_nFrameWidth;
	int m_nFrameHeight;	
    PixelFormat m_FramePixFmt;	

	int m_nFrameRate;	
	int m_nFrameRateBase;
	int m_nVideoBitRate;
	int m_nVideoBitRateTolerance;
	int m_nGopSize;	
	int64_t m_nVideoSrcFTP;
	CodecID m_videoCodecID;	

	CodecID m_audioCodecID;
	int m_nAudioSampleRate;
	int m_nAudioBitRate;	
	int m_nAudioChannels;
};


class CProfileManager
{
public:
	CProfileManager();
	virtual ~CProfileManager();
	
	int GetProfileCount();
	//COptionParameter* GetPorfile(int idx);
	COptionParameter* GetProfile(int idx);
	COptionParameter* GetProfile( PROFILE_TYPE etype);

private:
	void clearProfiles();
	COptionParameter* AddIpodProfile();
	COptionParameter* AddPspProfile();
	COptionParameter* Add3gppProfile();
	COptionParameter* AddDefaultProfile();
	COptionParameter* AddDvd();

private:
	vector<COptionParameter*> m_vecOption;
};

